home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / inet / internet-drafts / draft-faltstrom-macmime2-00.txt < prev    next >
Text File  |  1993-10-15  |  10KB  |  283 lines

  1. Network Working Group                                   Patrik Faltstrom
  2. Internet Draft: draft-faltstrom-macmime2-00                 Dave Crocker
  3. Expiration 4/94                                             Erik E. Fair
  4.                                                         October 15, 1993
  5.  
  6.                MIME Content Type for BinHex encoded files
  7.  
  8.  
  9.  
  10. 1.  Status of this Memo
  11.  
  12.    This document is an Internet Draft.  Internet Drafts are working
  13.    documents of the Internet Engineering Task Force (IETF), its Areas,
  14.    and its Working Groups.  Note that other groups may also distribute
  15.    working documents at any timne.  It is not appropriate to use
  16.    Internet Drafts as reference material or to cite them other than as
  17.    a "working draft" or "work in progress".  Please check the
  18.    1idabstracts.txt listing contained in the internet-drafts Shadow
  19.    Directories on nic.ddn.mil, nnsc.nsf.net, nic.nordu.net,
  20.    ftp.nisc.sri.com, or munnari.oz.au to learn the current status of
  21.    any Internet Draft.
  22.  
  23.    This specification is intended as an Informational document for
  24.    transmission of files with the use of Macintosh specific encoding
  25.    using BinHex4.0.  For maximal interoperability, it is recommended
  26.    that MIME-based application/applefile be used instead.
  27.  
  28.  
  29. 2.  Abstract
  30.  
  31.    This memo describes the format to use when sending BinHex4.0 files
  32.    via MIME [BORE93].  The format is compatible with existing
  33.    mechanisms for distributing Macintosh files.  Only when available
  34.    software and/or user practice dictates, should this method be
  35.    employed.  It is recommended to use application/applefile for
  36.    maximum interoperability.
  37.  
  38.  
  39. 3.  Introduction
  40.  
  41.    Files on the Macintosh consists of two parts, called forks:
  42.  
  43.    DATA FORK:       The actual data included in the file.  The Data
  44.                     fork is typically the only meaningful part of a
  45.                     Macintosh file on a non-Macintosh computer system.
  46.                     For example, if a Macintosh user wants to send a
  47.                     file of data to a user on an IBM-PC, she would only
  48.                     send the Data fork.
  49.  
  50.    RESOURCE FORK:   Contains a collection of arbitrary attribute/value
  51.                     pairs, including program segments, icon bitmaps,
  52.                     and parametric values.
  53.  
  54.  
  55. Faltstrom, Crocker, Fair                                        [Page 1]
  56.  
  57. Internet Draft       Content Type for BinHex files     October 15, 1993
  58.  
  59.    Additional information regarding Macintosh files is stored by the
  60.    Finder has in a hidden file, called the "Desktop Database".
  61.  
  62.    Because of the complications in storing different parts of a
  63.    Macintosh file in a non-Macintosh filesystem that only handles
  64.    consecutive data in one part, it is common to convert the Macintosh
  65.    file into some other format before transferring it over the network.
  66.  
  67.    AppleDouble file format [APPL90], encoded in MIME as
  68.    multipart/appledouble and application/applefile is the preferred
  69.    format for a Macintosh file that is to be included in an Internet
  70.    mail message, because it provides recipients with Macintosh
  71.    computers the entire document, including Icons and other Macintosh
  72.    specific information, while other users easily can extract the Data
  73.    fork (the actual data).
  74.  
  75.    However, this specification provides for use of the currently
  76.    popular BinHex4.0 encoding schemes, as a convinience to the
  77.    installed base of users.
  78.  
  79.  
  80. 4.  MIME format for BinHex4.0
  81.  
  82.    MIME-base Apple information is specified by:
  83.  
  84.    MIME type-name:            APPLICATION
  85.    MIME subtype name:         MAC-BINHEX40
  86.    Required parameters:       none
  87.    Optional parameters:       NAME, which must only consist of
  88.                               seven-bit US-ASCII characters excluding
  89.                               SPACE, CTLS, and "tspecials" as defined
  90.                               in RFC-1521 [BORE93].
  91.    Encoding considerations:   none
  92.    Security considerations:   See separate section in the document
  93.    Published specification:   Appendix A
  94.    Rationale:                 Permits MIME-based transmission of data
  95.                               with Apple Macintosh file system specific
  96.                               information using a currently popular,
  97.                               though platform specific, format.
  98.  
  99.  
  100.    4a.  Detail specific to MIME-based usage
  101.  
  102.       Macintosh documents do not always need to be sent in a special
  103.       format.  Those documents with well-known MIME types and
  104.       non-existent or trivial resource forks can be sent as regular
  105.       MIME body parts, without use of AppleSingle, AppleDouble or
  106.       BinHex4.0.
  107.  
  108.       Documents which lack a data fork should always be sent as
  109.       application/applefile.
  110.  
  111.  
  112. Faltstrom, Crocker, Fair                                        [Page 2]
  113.  
  114. Internet Draft       Content Type for BinHex files     October 15, 1993
  115.  
  116.       All other documents should normally sent as
  117.       multipart/appledouble.  This includes documents with non-trivial
  118.       resource forks, and documents without corresponding well-known
  119.       MIME types.
  120.  
  121.       It may be valuable in some cases to allow the user to choose one
  122.       format over another, either because he disagrees with the
  123.       implementor's definition of "trivial" resource forks, or for
  124.       reasons of his own.
  125.  
  126.       Only when available software and/or user practice dictates,
  127.       should application/mac-binhex40 be employed.
  128.  
  129.  
  130. 5.  BinHex
  131.  
  132.    BinHex 4.0 is a propular means of encoding Macintosh files for
  133.    archiving on non-Macintosh file systems and for transmission via
  134.    Internet mail.  (See Appendix A for a brief description of the
  135.    BinHex 4.0 format.)
  136.  
  137.    The content-type application/mac-binhex40 indicates that the body of
  138.    the mail is a BinHex4.0 file.  Even though the BinHex encoding
  139.    consists of characters which are not the same as those used in
  140.    Base64 (those regarded as safe according to RFC-1521 [BORE93]) a
  141.    transportation encoding should not be done.
  142.  
  143.    Even though a BinHex file includes the original Macintosh filename,
  144.    it is recommended that a name parameter be included on the
  145.    Content-Type header to give the recipient a hint as to what file is
  146.    attached.  The value of the name parameter must consist of seven-bit
  147.    US-ASCII characters excluding SPACE, CTLS, and "tspecials" as
  148.    defined in RFC- 1521 [BORE93].
  149.  
  150.  
  151.    5a.  BinHex example
  152.  
  153.         Content-Type: application/mac-binhex40; name="car.hqx"
  154.  
  155.             [The BinHex4.0 file goes here]
  156.  
  157.  
  158. 6.  References
  159.  
  160.    APPL90   AppleSingle/AppleDouble Formats for Foreign Files
  161.             Developer's Note, Apple Computer, Inc., 1990
  162.  
  163.    BORE93   Borenstein N., and N. Freed, MIME (Multipurpose Internet
  164.             Mail Extensions): Mechanisms for Specifying and Describing
  165.             the Format of Internet Message Bodies, RFC 1521, Bellcore,
  166.             Innosoft, September 1993.
  167.  
  168.  
  169.  
  170. Faltstrom, Crocker, Fair                                        [Page 3]
  171.  
  172. Internet Draft       Content Type for BinHex files     October 15, 1993
  173.  
  174. 7.  Security Considerations
  175.  
  176.    To the extent that application/mac-binhex40 facilitates the
  177.    transmission of operating-system sensitive data, it may open a door
  178.    for easier relaxation of security rules than is intended either by
  179.    the sender of the administrator of the sender's system.
  180.  
  181.  
  182. 8.  Acknowledgements
  183.  
  184.    Thanks to all of the people on the ietf-822 list who have provided
  185.    much meaningful input for this document.  Some of them must though
  186.    be remembered by name, because they have almost crushed my mailbox
  187.    the last weeks with a very nice and interesting debate:
  188.  
  189.       Johan Berglund, Steve Dorner, David Gelhar, David Herron,
  190.       Raymond Lau, Jamey Maze, John B. Melby, Jan Michael Rynning,
  191.       Rens Troost, Peter Svanberg
  192.  
  193.  
  194. 9.  Authors Addresses
  195.    Patrik Faltstrom
  196.    Department of Numerical Analysis and Computing Science
  197.    Royal Institute of Technology
  198.    S-100 44 Stockholm
  199.    Sweden
  200.  
  201.    Email: paf@nada.kth.se
  202.  
  203.    Dave Crocker
  204.    675 Spruce.  Dr.
  205.    Sunnyvale, CA 94086
  206.    USA
  207.  
  208.    Email: dcrocker@mordor.stanford.edu
  209.  
  210.    Erik E. Fair
  211.    Engineering Computer Operations
  212.    Apple Computer Inc.
  213.  
  214.    Email: fair@apple.com
  215.  
  216.  
  217. Appendix A.  The BinHex format
  218.  
  219.    Here is a description of the Hqx7 (7 bit format as implemented in
  220.    BinHex 4.0) formats for Macintosh Application and File transfers.
  221.  
  222.    The main features of the format are:
  223.  
  224.  
  225.  
  226.  
  227. Faltstrom, Crocker, Fair                                        [Page 4]
  228.  
  229. Internet Draft       Content Type for BinHex files     October 15, 1993
  230.  
  231.  
  232.    1) Error checking even using ASCII download
  233.    2) Compression of repetitive characters
  234.    3) 7 bit encoding for ASCII download
  235.  
  236.    The format is processed at three different levels:
  237.  
  238.       1) 8 bit encoding of the file:
  239.  
  240.  
  241.    Byte:    Length of FileName (1->63)
  242.    Bytes:   FileName ("Length" bytes)
  243.    Byte:    Version
  244.    Long:    Type
  245.    Long:    Creator
  246.    Word:    Flags (And $F800)
  247.    Long:    Length of Data Fork
  248.    Long:    Length of Resource Fork
  249.    Word:    CRC
  250.    Bytes:   Data Fork ("Data Length" bytes)
  251.    Word:    CRC
  252.    Bytes:   Resource Fork ("Rsrc Length" bytes)
  253.    Word:    CRC
  254.  
  255.  
  256.       2) Compression of repetitive characters.
  257.  
  258.    ($90 is the marker, encoding is made for 3->255 characters)
  259.  
  260.    00 11 22 33 44 55 66 77   -> 00 11 22 33 44 55 66 77
  261.    11 22 22 22 22 22 22 33   -> 11 22 90 06 33
  262.    11 22 90 33 44            -> 11 22 90 00 33 44
  263.  
  264.    The whole file is considered as a stream of bits.  This stream will
  265.    be divided in blocks of 6 bits and then converted to one of 64
  266.    characters contained in a table.  The characters in this table have
  267.    been chosen for maximum noise protection.  The format will start
  268.    with a ":" (first character on a line) and end with a ":".
  269.    There will be a maximum of 64 characters on a line.  It must be
  270.    preceded, by this comment, starting in column 1 (it does not start
  271.    in column 1 in this document):
  272.  
  273.     (This file must be converted with BinHex 4.0)
  274.  
  275.    Any text before this comment is to be ignored.
  276.  
  277.    The characters used is:
  278.  
  279.     !"#$%&'()*+,- 012345689@ABCDEFGHIJKLMNPQRSTUVXYZ[`abcdefhijklmpqr
  280.  
  281.  
  282. Faltstrom, Crocker, Fair                                        [Page 5]
  283.